home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / Snippets / Toolbox / Scrap Parsing / simple.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-24  |  2.5 KB  |  72 lines  |  [TEXT/MPS ]

  1.  
  2. #include <Types.h>
  3. #include <memory.h>
  4. #include <Packages.h>
  5. #include <Errors.h>
  6. #include <quickdraw.h>
  7. #include <fonts.h>
  8. #include <dialogs.h>
  9. #include <windows.h>
  10. #include <menus.h>
  11. #include <events.h>
  12. #include <OSEvents.h>
  13. #include <Desk.h>
  14. #include <diskinit.h>
  15. #include <OSUtils.h>
  16. #include <resources.h>
  17. #include <toolutils.h>
  18. #include <AppleEvents.h>
  19. #include <EPPC.h>
  20. #include <GestaltEqu.h>
  21. #include <PPCToolbox.h> 
  22. #include <Processes.h>
  23. #include <Balloons.h>
  24. #include <aliases.h>
  25. #include <Scrap.h>
  26.  
  27.  
  28. typedef void (*myDrawProcPtr)(WindowPtr theWindow); 
  29. typedef void (*myClickProcPtr)(WindowPtr theWindow,EventRecord *theEvent); 
  30. typedef void (*windowSaveProc)(WindowPtr theWindow); 
  31. typedef void (*myCloseProcPtr)(WindowPtr theWindow); 
  32. typedef void (*mySizeProcPtr)(WindowPtr theWindow,short how); 
  33. typedef void (*myActivateProcPtr)(WindowPtr theWindow,Boolean active); 
  34.  
  35. /* windowControl is the structure attached to every window I create (in the refCon */
  36. /* field) that contains all the information I need to know about the window. */
  37. /* data, procedure pointers for controlling, and anything else gets put in this */
  38. /* struct.  That makes my windows autonomous */
  39. struct windowControl {
  40.     unsigned long windowID;                                 /* master ID number  */
  41.     myDrawProcPtr drawMe;                                         /* content drawing procedure pointer */
  42.     myClickProcPtr clickMe;                                        /* content click routine */
  43.     myCloseProcPtr closeMe;                                        /* document close procedure pointer */
  44.     mySizeProcPtr sizeMe;                                            /* size procedure */
  45.     myActivateProcPtr activateMe;
  46.     AliasHandle fileAliasHandle;                            /* alias for this document */
  47.     Boolean windowDirty;
  48.     Handle generalData;                                        /* cast to whatever you need as you need it */
  49. };
  50. typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
  51.  
  52. struct AEinstalls {
  53.     AEEventClass theClass;
  54.     AEEventID theEvent;
  55.     EventHandlerProcPtr theProc;
  56. };
  57. typedef struct AEinstalls AEinstalls;
  58.  
  59. enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
  60. /* menu enums */
  61. enum {kMBarID = 128};
  62. enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
  63.  
  64. /* file menu enums */
  65. enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
  66.  
  67. /* general purpose enums */
  68. enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130};
  69.  
  70. enum {kMinHeight = 200};
  71.  
  72. enum {kGeneralStrings = 128};